import { postRequest,getRequest } from '@/lib/smart-request';
export const userApi = {
	getUserInfo:(uid)=>{
		return getRequest('/v1/user_base?user_id='+uid)
	},
	loginByMini: (param) => {
	  return postRequest('/v1/login', param);
	},
	loginSave:(param)=>{
		return postRequest('/v1/login_update',param);
	},
	enroll:(param)=>{
		return postRequest('/v1/userinfo',param)
	},
	queryCourses:(page)=>{
		return getRequest('/v1/courses_list?page='+page)
	},
	queryDetail:(cid)=>{
		return getRequest(`/v1/course_detail/${cid}`)
	},
	queryCenter:(uid)=>{
		return getRequest('/v1/user?user_id='+uid)
	},
	studyLesson:(param)=>{
		return postRequest('/v1/study',param)
	},
	// ----------------------------------
	selectCourses:(page)=>{
		return getRequest('/v1/courses?page='+page)
	},
	inEnroll:(param)=>{
		return postRequest('/v1/applicants',param)
	},
	collected:(param)=>{
		return postRequest('/v1/collection_type',param)
	},
	inEnrollList:(uid,page)=>{
		return getRequest('/v1/applicant_list?user_id='+uid+'&page='+page)
	},
	collectedList:(uid,page)=>{
		return getRequest('/v1/collection_list?user_id='+uid+'&page='+page)
	}
};